package com.fsnbigdata.domain;
import org.hibernate.validator.constraints.Length;
import org.springframework.roo.addon.javabean.annotations.RooEquals;
import org.springframework.roo.addon.javabean.annotations.RooJavaBean;
import org.springframework.roo.addon.javabean.annotations.RooToString;
import org.springframework.roo.addon.jpa.annotations.entity.RooJpaEntity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Version;
import io.springlets.format.EntityFormat;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import org.springframework.format.annotation.NumberFormat;
import java.util.Objects;
import javax.persistence.Entity;

/**
 * = ListQuadratItem
 *
 * TODO Auto-generated class documentation
 *
 */
@RooJavaBean
@RooToString
@RooJpaEntity
@RooEquals(isJpaEntity = true)
@Entity
@EntityFormat
public class ListQuadratItem {

    /**
     * TODO Auto-generated attribute documentation
     *
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    /**
     * TODO Auto-generated attribute documentation
     *
     */
    @Version
    private Integer version;

    /**
     * TODO Auto-generated attribute documentation
     *
     */
    @ManyToOne(fetch = FetchType.EAGER)
    @EntityFormat
    private ListQuadrat listQuadrat;

    /**
     * 名称
     */
    @Length(min = 0,max = 255,message = "样方名称长度必须为0-255")
    private String name;

    /**
     * 拉丁名称
     */
    @Length(min = 0,max = 255,message = "样方名称长度必须为0-255")
    private String latin;

    /**
     * 生物id
     */
    @NumberFormat
    private Long organismId;

    /**
     * 层次
     */
    @Length(min = 0,max = 255,message = "样方层次长度必须为0-255")
    private String itemlevel;

    /**
     * 株或多数度
     */
    @Length(min = 0,max = 255,message = "样方株或多数度长度必须为0-255")
    private String tree;

    /**
     * 覆盖度
     */
    @Length(min = 0,max = 255,message = "样方覆盖度长度必须为0-255")
    private String coverage;

    /**
     * 高度平均
     */
    @Length(min = 0,max = 255,message = "样方高度平均长度必须为0-255")
    private String heightAvg;

    /**
     * 高度最大
     */
    @Length(min = 0,max = 255,message = "样方高度最大长度必须为0-255")
    private String heightMax;

    /**
     * 胸径平均
     */
    @Length(min = 0,max = 255,message = "样方胸径平均长度必须为0-255")
    private String dbhAvg;

    /**
     * 胸径最大
     */
    @Length(min = 0,max = 255,message = "样方胸径最大长度必须为0-255")
    private String dbhMax;

    /**
     * 冠幅平均
     */
    @Length(min = 0,max = 255,message = "样方冠幅平均长度必须为0-255")
    private String canopyAvg;

    /**
     * 冠幅最大
     */
    @Length(min = 0,max = 255,message = "样方冠幅最大长度必须为0-255")
    private String canopyMax;

    /**
     * 茂盛度
     */
    @Length(min = 0,max = 255,message = "样方茂盛度长度必须为0-255")
    private String flourish;

    /**
     * 生活型
     */
    @Length(min = 0,max = 255,message = "样方生活型长度必须为0-255")
    private String biotype;

    /**
     * TODO Auto-generated attribute documentation
     *
     */
    public static final String ITERABLE_TO_ADD_CANT_BE_NULL_MESSAGE = "The given Iterable of items to add can't be null!";

    /**
     * TODO Auto-generated attribute documentation
     *
     */
    public static final String ITERABLE_TO_REMOVE_CANT_BE_NULL_MESSAGE = "The given Iterable of items to add can't be null!";

    /**
     * This `equals` implementation is specific for JPA entities and uses
     * the entity identifier for it, following the article in
     * https://vladmihalcea.com/2016/06/06/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
     *
     * @param obj
     * @return Boolean
     */
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        // instanceof is false if the instance is null
        if (!(obj instanceof ListQuadratItem)) {
            return false;
        }
        return getId() != null && Objects.equals(getId(), ((ListQuadratItem) obj).getId());
    }

    /**
     * This `hashCode` implementation is specific for JPA entities and uses a fixed `int` value to be able
     * to identify the entity in collections after a new id is assigned to the entity, following the article in
     * https://vladmihalcea.com/2016/06/06/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
     *
     * @return Integer
     */
    public int hashCode() {
        return 31;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Long
     */
    public Long getId() {
        return this.id;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Integer
     */
    public Integer getVersion() {
        return this.version;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param version
     */
    public void setVersion(Integer version) {
        this.version = version;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return ListQuadrat
     */
    public ListQuadrat getListQuadrat() {
        return this.listQuadrat;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param listQuadrat
     */
    public void setListQuadrat(ListQuadrat listQuadrat) {
        this.listQuadrat = listQuadrat;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getName() {
        return this.name;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getLatin() {
        return this.latin;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param latin
     */
    public void setLatin(String latin) {
        this.latin = latin;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Long
     */
    public Long getOrganismId() {
        return this.organismId;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param organismId
     */
    public void setOrganismId(Long organismId) {
        this.organismId = organismId;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getItemlevel() {
        return this.itemlevel;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param itemlevel
     */
    public void setItemlevel(String itemlevel) {
        this.itemlevel = itemlevel;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getTree() {
        return this.tree;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param tree
     */
    public void setTree(String tree) {
        this.tree = tree;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getCoverage() {
        return this.coverage;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param coverage
     */
    public void setCoverage(String coverage) {
        this.coverage = coverage;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getHeightAvg() {
        return this.heightAvg;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param heightAvg
     */
    public void setHeightAvg(String heightAvg) {
        this.heightAvg = heightAvg;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getHeightMax() {
        return this.heightMax;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param heightMax
     */
    public void setHeightMax(String heightMax) {
        this.heightMax = heightMax;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getDbhAvg() {
        return this.dbhAvg;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param dbhAvg
     */
    public void setDbhAvg(String dbhAvg) {
        this.dbhAvg = dbhAvg;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getDbhMax() {
        return this.dbhMax;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param dbhMax
     */
    public void setDbhMax(String dbhMax) {
        this.dbhMax = dbhMax;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getCanopyAvg() {
        return this.canopyAvg;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param canopyAvg
     */
    public void setCanopyAvg(String canopyAvg) {
        this.canopyAvg = canopyAvg;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getCanopyMax() {
        return this.canopyMax;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param canopyMax
     */
    public void setCanopyMax(String canopyMax) {
        this.canopyMax = canopyMax;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getFlourish() {
        return this.flourish;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param flourish
     */
    public void setFlourish(String flourish) {
        this.flourish = flourish;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String getBiotype() {
        return this.biotype;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param biotype
     */
    public void setBiotype(String biotype) {
        this.biotype = biotype;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return String
     */
    public String toString() {
        return "ListQuadratItem {" + "id='" + id + '\'' + ", version='" + version + '\'' + ", name='" + name + '\'' + ", latin='" + latin + '\'' + ", organismId='" + organismId + '\'' + ", itemlevel='" + itemlevel + '\'' + ", tree='" + tree + '\'' + ", coverage='" + coverage + '\'' + ", heightAvg='" + heightAvg + '\'' + ", heightMax='" + heightMax + '\'' + ", dbhAvg='" + dbhAvg + '\'' + ", dbhMax='" + dbhMax + '\'' + ", canopyAvg='" + canopyAvg + '\'' + ", canopyMax='" + canopyMax + '\'' + ", flourish='" + flourish + '\'' + ", biotype='" + biotype + '\'' + ", ITERABLE_TO_ADD_CANT_BE_NULL_MESSAGE='" + ITERABLE_TO_ADD_CANT_BE_NULL_MESSAGE + '\'' + ", ITERABLE_TO_REMOVE_CANT_BE_NULL_MESSAGE='" + ITERABLE_TO_REMOVE_CANT_BE_NULL_MESSAGE + '\'' + "}" + super.toString();
    }
}
